import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
    //路由重定向
    redirect: '/Students',
    children: [
      {
        path: '/Students',
        name: 'Students',
        component: () => import('../views/StudentsView.vue')
      },
      {
        path: '/about',
        name: 'about',
        component: () => import('../views/AboutView.vue')
      },
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
